package com.mazaiting.manager.api.fallback;

import com.mazaiting.common.core.domain.result.Result;
import com.mazaiting.common.core.domain.result.ResultCode;
import com.mazaiting.manager.api.IUserFeignClient;
import com.mazaiting.manager.dto.UserAuthDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 用户降级
 *
 * @author mazaiting
 * @create_time 2022/9/19 00:14
 */
@Slf4j
@Component
public class UserFeignFallbackClient implements IUserFeignClient {
    @Override
    public Result<UserAuthDTO> getUserByUsername(String username) {
        log.error("远程调用系统服务异常-根据用户名获取用户异常");
        return Result.failed(ResultCode.FEIGN_DEGRADATION);
    }

    @Override
    public Result<UserAuthDTO> getUserByMobile(String mobile) {
        log.error("远程调用系统服务异常-根据用户手机号获取用户异常");
        return Result.failed(ResultCode.FEIGN_DEGRADATION);
    }
}
